import {
  mapGetters
} from 'vuex'
export default {
  computed: {
    ...mapGetters('m_cart', ['total'])
  },
  watch: {
    total(){
      this.setTabBar()
    }
  },
  onShow() {
   this.setTabBar()
  },
    
  methods:{
    setTabBar(){
      uni.setTabBarBadge({
        index: 2,
        text: this.total + ''
      })
    }
  }

}
